define(['simple', 'attribute', 'declare'], function(S, Attribute, declare){
    var uuid = 0, Widget, $ = S.$;
    
    Widget = declare('Widget', Attribute, {
        id: '',
        node: '',
        container: '',
        className: 'simple-base',
        template: '',
        plugins: [],
        position: null,
        _pluginsInc: null,
        init: function(){
            this.node = this.get('node');
            this.container = this.get('container');
            //缓存该对象以便获取
            Widget._inc[this.get('id')] = this;
        },
        _getterId: function(id){
        
            return id ? id : 'widget-' + (uuid++);
        },
        _getterNode: function(node){
            if (!(node instanceof $)) {
                return $(node);
            }
            else {
                return node;
            }
        },
        renderUI: function(){
        
        }
    });
    
    Widget._inc = {};
    
    Widget.byId = function(id){
        return Widget._inc[id];
    }
    
    return Widget;
    
});
